/**
 * Copyright 2015-2016 eyaomall.cn
 * All rights reserved.
 *
 * @project
 * @author jackey
 * @version 1.0
 * @date 2016-01-06
 */
package com.eyaomall.wxmanage.dao;

import org.springframework.stereotype.Repository;

import com.eyaomall.wxmanage.model.po.Receipt;
import com.lycheeframework.core.annotation.NameSpace;
import com.lycheeframework.core.cmp.kit.IHTTPObject;
import com.lycheeframework.core.cmp.kit.Pages;
import com.lycheeframework.core.support.DaoSupport;
@Repository
@NameSpace("receipt")
public class ReceiptDao extends DaoSupport<Receipt> {

	/**
	 * 新增应收款单
	 * @param receipt
	 * @return
	 */
	public int create(Receipt receipt){
		super.insert(receipt);
		
		return receipt.getId();
	}
	
	/**
	 * 修改应收款单
	 * @param receipt
	 * @return
	 */
	public boolean update(Receipt receipt){
		
		return super.update(receipt) > 0 ? true : false;
	}
	
	/**
	 * 分页查询应收款单
	 * @param receipt
	 * @param httpObject
	 * @return
	 */
	public Pages<?> page(Receipt receipt,IHTTPObject httpObject){
		
		return super.page(receipt, httpObject);
	}
	
	/**
	 * 根据ID查询应收款单
	 * @param id
	 * @return
	 */
	public Receipt queryById(Integer id){
		Receipt receipt = new Receipt();
		receipt.setId(id);
		
		return (Receipt) super.query(receipt);
	}
}
